/*
	This file is part of cpp-ethereum.

	cpp-ethereum is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	cpp-ethereum is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with cpp-ethereum.  If not, see <http://www.gnu.org/licenses/>.
*/
/** @file Params.cpp
 * @author Gav Wood <i@gavwood.com>
 * @date 2014
 */

#include "Params.h"
#include "Common.h"

using namespace std;
namespace dev
{
namespace eth
{

//--- BEGIN: AUTOGENERATED FROM github.com/ethereum/common/params.json
u256 c_maximumExtraDataSize;
u256 c_minGasLimit;
u256 c_gasLimitBoundDivisor;
u256 c_minimumDifficulty;
u256 c_difficultyBoundDivisor;
u256 c_durationLimit;
u256 c_blockReward;
u256 c_gasFloorTarget;
//--- END: AUTOGENERATED FROM /feeStructure.json

#if ETH_FRONTIER
Network c_network = resetNetwork(Network::Frontier);
#else
Network c_network = resetNetwork(Network::Olympic);
#endif

Network resetNetwork(Network _n)
{
	c_network = _n;
	c_maximumExtraDataSize = c_network == Network::Olympic ? 1024 : 32;
	switch(_n)
	{
	case Network::Turbo:
		c_minGasLimit = 100000000;
		break;
	case Network::Olympic:
		c_minGasLimit = 125000;
		break;
	case Network::Frontier:
		c_minGasLimit = 5000;
		break;
	}
	c_gasFloorTarget = 3141592;
	c_gasLimitBoundDivisor = 1024;
	c_minimumDifficulty = 131072;
	c_difficultyBoundDivisor = 2048;
	c_durationLimit = c_network == Network::Turbo ? 2 : c_network == Network::Olympic ? 8 : 13;
	c_blockReward = c_network == Network::Olympic ? (1500 * finney) : (5 * ether);
	return _n;
}

}
}

